package com.richinfo.exception;

/**
 * message output e.g. 接口调用异常[api: "/city/get"][reqId: 123ada123123]: userId不能为空
 */
public class ApiInvokeException extends BaseRuntimeException {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6397848155132277700L;

	public ApiInvokeException(String apiName, String reqId, String param, String code, String message,
                              Throwable cause) {
		super(code, "接口调用异常[api: \"" + apiName + "\"][reqId: " + reqId + "][param: " + param + "]: " + message, cause);
	}

	public ApiInvokeException(String apiName, String reqId, String param, String code, String message) {
		this(apiName, reqId, param, code, message, null);
	}

	public ApiInvokeException(String apiName, String param, String code, String message, Throwable cause) {
		super(apiName, "接口调用异常[api: \"" + apiName + "\"][param: " + param + "]: " + message, cause);
	}

	public ApiInvokeException(String apiName, String param, Throwable cause) {
		this(apiName, null, param, null, null, null);
	}

}
